#region Used Namespaces

using System;
using ContactPrinter.Model.Interfaces;
using Google.GData.Extensions;

#endregion

namespace ContactPrinter.Model
{
    public class GoogleOrganization : IOrganization
    {
        private readonly Organization organization;

        public GoogleOrganization(Organization organization)
        {
            this.organization = organization;
        }

        #region Implementation of IOrganization

        public string Label
        {
            get { return organization.Label; }
            set { organization.Label = value; }
        }

        public string Name
        {
            get { return organization.Name; }
            set { organization.Name = value; }
        }

        public string Title
        {
            get { return organization.Title; }
            set { organization.Title = value; }
        }

        public string Symbol
        {
            get { return organization.Symbol; }
            set { organization.Symbol = value; }
        }

        public string Department
        {
            get { return organization.Department; }
            set { organization.Department = value; }
        }

        public string JobDescription
        {
            get { return organization.JobDescription; }
            set { organization.JobDescription = value; }
        }

        public string Location
        {
            get { return organization.Location; }
            set { organization.Location = value; }
        }

        public bool Primary
        {
            get { return organization.Primary; }
            set { organization.Primary = value; }
        }

        public bool Home
        {
            get { return organization.Home; }
        }

        public bool Other
        {
            get { return organization.Other; }
        }

        #endregion

        #region Implementation of IComparable

        public int CompareTo(object obj)
        {
            var otherOrganization = obj as IOrganization;
            if (otherOrganization == null)
                throw new ArgumentException("Object is not a IName");

            return String.CompareOrdinal(Name, otherOrganization.Name);
        }

        #endregion
    }
}